package com.dog.basics.security.util;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: d-basic-composition
 *
 * @description: 验证码背景图片
 *
 * @author: Guo
 *
 * @create: 2019-08-12 18:22
 **/

@Getter
@AllArgsConstructor
public enum WordCodeEnum {
	LPN(0,"1.png"),
	ONE(1,"2.png"),
	TWO(2,"3.png"),
	THREE(3,"4.png"),
	FOUR(4,"5.png"),
	FIVE(5,"6.png"),
	SIX(6,"7.png"),
	SEVEN(7,"8.png"),
	EIGHT(8,"9.png"),
	NINE(9,"10.png"),
	TEN(10,"11.png"),
	ELEVEN(11,"12.png"),
	TWELVE(12,"13.png"),
	THIRTEEN(13,"14.png"),
	FOURTEEN(14,"15.png"),
	FIFTEEN(15,"16.png"),
	SIXTEEN(16,"17.png"),
	SEVENTEEN(17,"18.png"),
	EIGHTEEN(18,"19.png"),
	NINETEEN(19,"20.png"),
	TWENTY(20,"21.png"),
	TWENTYONE(21,"22.png"),
	TWENTYTWO(22,"23.png"),
	TWENTYTHREE(23,"24.png"),
	TWENTYFOUR(24,"25.png"),
	TWENTYFIVE(25,"26.png"),
	TWENTYSIX(26,"27.png"),
	TWENTYSEVEN(27,"28.png"),
	TWENTYEIGHT(28,"29.png"),
	TWENTYNINE(29,"30.png"),
	THIRTY(30,"15.png"),
	;

	/**
	 * 类型
	 */
	private int code;
	/**
	 * 图片名称
	 */
	private String name;

	/**
	 * 根据Code获取Url
	 * @param code
	 * @return
	 */
	public static String getMessageByCode(int code) {
		for (WordCodeEnum wordCodeEnum : WordCodeEnum.values()) {
			if (code == wordCodeEnum.getCode()) {
				return wordCodeEnum.getName();
			}
		}
		return null;
	}

}
